<!DOCTYPE html>
<html lang="">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="AndroidStudio 3.0 会为您的应用程序创建一个自适应图标，该图标仅在sdk 26中可用"/>




  <meta name="keywords" content="整理, ZOE码坊" />










  <link rel="alternate" href="/blog/default" title="ZOE码坊">




  <link rel="shortcut icon" type="image/x-icon" href="/blog/favicon.ico?v=2.9.0" />



<link rel="canonical" href="https://luys.gitee.io/blog/2018/09/02/Android工作学习收集整理（五月）/"/>



  <link rel="stylesheet" type="text/css" href="/blog/lib/fancybox/jquery.fancybox.css" />




  <link rel="stylesheet" type="text/css" href="/blog/lib/nprogress/nprogress.min.css" />



<link rel="stylesheet" type="text/css" href="/blog/css/style.css?v=2.9.0" />



  



  <script id="baidu_push">
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>





  <script src="//cdn1.lncld.net/static/js/3.1.1/av-min.js"></script>
  <script id="leancloud">
    AV.init({
      appId: "kdb8x3rBNollDwJ8ulzKQPb3-gzGzoHsz",
      appKey: "dRlqoI7xVfUXI5urx5r6uOYC"
    });
  </script>




<script>
  window.config = {"title":"ZOE码坊","subtitle":null,"description":null,"author":"Sam Lu","language":null,"timezone":null,"url":"https://luys.gitee.io/blog","root":"/blog/","permalink":":year/:month/:day/:title/","permalink_defaults":null,"source_dir":"source","public_dir":"public/blog","tag_dir":"tags","archive_dir":"archives","category_dir":"categories","code_dir":"downloads/code","i18n_dir":":lang","skip_render":null,"new_post_name":":title.md","default_layout":"post","titlecase":false,"external_link":true,"filename_case":0,"render_drafts":false,"post_asset_folder":false,"relative_link":false,"future":true,"highlight":{"enable":true,"auto_detect":false,"line_number":true,"tab_replace":null},"default_category":"uncategorized","category_map":null,"tag_map":null,"date_format":"YYYY-MM-DD","time_format":"HH:mm:ss","per_page":10,"pagination_dir":"page","theme":"even","deploy":{"type":"git","repo":"https://gitee.com/luys/blog.git","branch":"master"},"ignore":[],"keywords":null,"index_generator":{"per_page":10,"order_by":"-date","path":""},"category_generator":{"per_page":10},"tag_generator":{"per_page":10},"archive_generator":{"per_page":10,"yearly":true,"monthly":true,"daily":false},"marked":{"gfm":true,"pedantic":false,"sanitize":false,"tables":true,"breaks":true,"smartLists":true,"smartypants":true,"modifyAnchors":"","autolink":true},"server":{"port":4000,"log":false,"compress":false,"header":true},"since":2015,"favicon":"/favicon.ico","rss":"default","menu":{"Home":"/","Tags":"/tags","Categories":"/categories"},"color":"Cobalt Blue","toc":true,"fancybox":true,"pjax":true,"copyright":{"enable":true,"license":"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\">知识共享署名-非商业性使用 4.0 国际许可协议</a>"},"reward":{"enable":false,"qrCode":{"wechat":null,"alipay":null}},"social":{"email":"ltym_lys@126.com","stack-overflow":null,"twitter":null,"facebook":null,"linkedin":null,"google":null,"github":"https://github.com/ltym2016","weibo":null,"zhihu":null,"douban":null,"pocket":null,"tumblr":null,"instagram":null},"leancloud":{"app_id":"kdb8x3rBNollDwJ8ulzKQPb3-gzGzoHsz","app_key":"dRlqoI7xVfUXI5urx5r6uOYC"},"baidu_analytics":null,"baidu_verification":null,"google_analytics":null,"google_verification":null,"disqus_shortname":null,"changyan":{"appid":null,"appkey":null},"livere_datauid":null,"version":"2.9.0"};
</script>

    <title> Android工作学习收集整理（五月） - ZOE码坊 </title>
  </head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/blog/." class="logo">ZOE码坊</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/blog/">
        <li class="mobile-menu-item">
          
          
            首页
          
        </li>
      </a>
    
      <a href="/blog/tags">
        <li class="mobile-menu-item">
          
          
            标签
          
        </li>
      </a>
    
      <a href="/blog/categories">
        <li class="mobile-menu-item">
          
          
            分类
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/blog/." class="logo">ZOE码坊</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/">
            
            
              首页
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/tags">
            
            
              标签
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/categories">
            
            
              分类
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          Android工作学习收集整理（五月）
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2018-09-02
        </span>
        
          <div class="post-category">
            
              <a href="/blog/categories/月度整理/">月度整理</a>
            
          </div>
        
        
        <div class="post-visits"
             data-url="/blog/2018/09/02/Android工作学习收集整理（五月）/"
             data-title="Android工作学习收集整理（五月）">
            阅读次数 0
          </div>
        
      </div>
    </header>

    
    


    <div class="post-content">
      
        <ul>
<li><p>AndroidStudio 3.0 会为您的应用程序创建一个自适应图标，该图标仅在sdk 26中可用。使用xml文件，mipmap-anydpi-v26夹中的文件来使用自适应圆形图标，创建的时候默认生成。需要注意图标会小一圈，让UI切正常大小的替换一下就好。<a href="http://www.jb51.net/article/129989.htm" target="_blank" rel="noopener">Android桌面图标自动生成</a></p>
</li>
<li><p>使用alibaba/vlayout时，onBindViewHolder未分发的问题。<a href="https://github.com/alibaba/vlayout/issues/295" target="_blank" rel="noopener">解决方法</a></p>
</li>
<li><p>NestedScrollView与RecyclerView嵌套,导致滚动惯性消失</p>
<blockquote>
<p>mRecyclerView.setNestedScrollingEnabled(false);</p>
</blockquote>
</li>
<li><p><a href="https://blog.csdn.net/ss1168805219/article/details/52458716" target="_blank" rel="noopener">Android Studio commit设置忽略文件</a></p>
<blockquote>
<ul>
<li>一种在AndroidStudio里配置：Settings –&gt; Version Control –&gt; Ignored Files</li>
<li>一种在idel文件的workspace.xml里配置<br>实际操作中发现下次commit的时候，并没有生效。原因是添加忽略文件必须在关联svn之前进行，否则无效。</li>
</ul>
</blockquote>
</li>
<li><p>git push 项目失败，报：</p>
</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Push failed</span><br><span class="line">Failed with error: The remote end hung up unexpectedly</span><br><span class="line">The remote end hung up unexpectedly</span><br><span class="line">RPC failed; HTTP 411 curl 22 The requested URL returned error: 411 Length Required</span><br></pre></td></tr></table></figure>
<blockquote>
<p>出现这个错误的原因是git 通过http post的大小有限制，应该调大一些就可以了,打开项目中隐藏的.git文件夹，找到config配置文件，在后天添加如下配置<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">[http]  </span><br><span class="line">    postBuffer = 524288000</span><br></pre></td></tr></table></figure></p>
</blockquote>
<ul>
<li>约束布局中处理居中问题：上下居中需要设置Bottom_toTopOf和Top_toBottomOf，水平居中类似。</li>
<li><p><a href="https://blog.csdn.net/mingli198611/article/details/8678513?_u_u_u=0.5681700699062227" target="_blank" rel="noopener">FLAG_ACTIVITY_REORDER_TO_FRONT</a></p>
<blockquote>
<p>使用此Flag需要注意的是：确保activity没有被finish，或者确保activity已经destroy</p>
</blockquote>
</li>
<li><p>每次弹出popupwindow后，想通过点击外部控件进行进行popupwindow间的切换，会发现点击外部控件的时候，只响应了隐藏当前popupwindow的事件，外部控件的点击事件并没有执行，需再次点击外部控件，才弹出popupwindow。解决办法：</p>
</li>
<li>想要执行外部控件的点击事件，只要把popupWindow.setFocusable(false);就可以了。存在缺陷：返回键不起作用，软键盘弹不出来。确定弃用</li>
<li>用PopupWindow.setTouchInterceptor获取手势坐标，再计算每个tabView的范围，确定某个范围内则强制点击performClick()。</li>
<li>多popupwindow切换的问题<blockquote>
<p>用PopupWindow.setTouchInterceptor获取手势坐标，再计算每个tabView的坐标范围(tabView.getLocationOnScreen(localPosition)获取View位置)，确定某个范围内则强制点击performClick()</p>
</blockquote>
</li>
<li><a href="https://mp.weixin.qq.com/s/FwZyHAAKaNbs35VnpaK8QA" target="_blank" rel="noopener">支付宝用的框架</a></li>
<li><p>fitSystemWindow在Fragment中使用</p>
<blockquote>
<p>如果fitSystemWindow设置在Fragment里面的第一个View中，在切换的时候发现只有第一个生效，后面的fragment不生效。 解决办法：获取statusbar的高度动态加上paddingtop</p>
</blockquote>
</li>
<li><p>popupwindow 内部布局是RecyclerView最后的item点击事件无效的问题</p>
<blockquote>
<p>解决办法：将item布局中的约束布局改成普通的LinearLayout等布局。</p>
</blockquote>
</li>
<li><include>标签只支持以android:layout_开头的属性。（android:id除外）</include></li>
<li>如果<include>指定了android:layout_*属性，那么android:layout_width和android:layout_height必须存在，否则其他属性无效。</include></li>
<li>程序anr，系统会在data/anr文件夹下，创建一个traces.txt</li>
<li><a href="https://www.jianshu.com/p/cbec7786d8f1" target="_blank" rel="noopener">Pair认识</a></li>
<li><a href="https://blog.csdn.net/liusheng_/article/details/53302253" target="_blank" rel="noopener">开发版和发布版SHA1</a></li>
<li>Wrapper 包装的意思</li>
<li>Activity Service Application 都是继承于ContextWrapper的</li>
</ul>

      
    </div>

    
      
      

  <div class="post-copyright">
    <p class="copyright-item">
      <span>原文作者: </span>
      <a href="https://luys.gitee.io/blog">Sam Lu</a>
    </p>
    <p class="copyright-item">
      <span>原文链接: </span>
      <a href="https://luys.gitee.io/blog/2018/09/02/Android工作学习收集整理（五月）/">https://luys.gitee.io/blog/2018/09/02/Android工作学习收集整理（五月）/</a>
    </p>
    <p class="copyright-item">
      <span>许可协议: </span>
      
      <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>



      
      
    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/blog/tags/整理/">整理</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/blog/2018/09/02/Android工作学习收集整理（六月）/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">Android工作学习收集整理（六月）</span>
        <span class="prev-text nav-mobile">上一篇</span>
      </a>
    
    
      <a class="next" href="/blog/2018/08/29/Android开发与艺术探索/">
        <span class="next-text nav-default">Android开发与艺术探索</span>
        <span class="prev-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
    
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="mailto:ltym_lys@126.com" class="iconfont icon-email" title="email"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
        
          <a href="https://github.com/ltym2016" class="iconfont icon-github" title="github"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
    
    
    
      
      <a href="/blog/atom.xml" class="iconfont icon-rss" title="rss"></a>
    
  </div>


<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://hexo.io/">Hexo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 - 
    <a class="theme-link" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>

  <span class="copyright-year">
    
    &copy; 
     
      2015 - 
    
    2018

    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Sam Lu</span>
  </span>
</div>

      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  

  



    
  



  
  





  
    <script type="text/javascript" src="/blog/lib/jquery/jquery.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/fancybox/jquery.fancybox.pack.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/pjax/jquery.pjax.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/nprogress/nprogress.min.js"></script>
  


    <script type="text/javascript" src="/blog/js/src/even.js?v=2.9.0"></script>

  </body>
</html>
